import { reactRouter } from "@react-router/dev/vite";
import UnoCSS from 'unocss/vite'
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import AutoImport from 'unplugin-auto-import/vite'
import path from 'path';

export default defineConfig({
  plugins: [
    UnoCSS(),
    reactRouter(),
    tsconfigPaths(), 
    AutoImport({
      imports: [
        'react',
        'react-router',
        'date-fns',
        'ahooks'
      ],      
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './app'),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/style/style.scss" as *;`,
      },
    },
  },
});   
